import 'package:flutter/material.dart';
import 'package:flutter_color_plugin/flutter_color_plugin.dart';
import 'package:detect/utils/global.dart';
import 'package:detect/utils/image_util.dart';

class EmptyWidget extends StatelessWidget {
  final String? title;
  final String? subTitle;

  const EmptyWidget({super.key, this.title = '暂无数据', this.subTitle = '您还没有相关数据哦~'});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      child: FittedBox(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            ImageUtil.asset('static/images/empty.png', size: Global.ds(160)),
            Divider(height: Global.ds(16), color: Colors.transparent),
            Text(title!, softWrap: true, style: TextStyle(fontSize: Global.ds(16), color: ColorUtil.color("#666666"))),
            Divider(height: Global.ds(8), color: Colors.transparent),
            Text(subTitle!, softWrap: true, style: TextStyle(fontSize: Global.ds(12), color: ColorUtil.color("#999999"))),
          ],
        ),
      ),
    );
  }
}
